<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    /* 三个显示转换：1.Number(数据) 
                 2.parseInt(数据) 
                 3.parseFloat(数据)
    一个隐式转换：+ 
                 1.+号作为正号解析可以转换成Number 
                 2.任何数据和字符串相加结果都是字符串 */

    /* NaN(Not a Number)也是number类型的数据，代表非数字 */
    // ------------------------
    /* let str = '123'
    console.log(str);
    console.log(Number(str));
    console.log(Number('李四'));
    // ------------------------
    // let salary = Number(prompt('请输入你的薪资:')) 此式子等于let salary = + prompt('请输入你的薪资:')
    let salary = '2500'
    console.log(salary);
    console.log(Number(salary));
    console.log(+salary);
    console.log('123');
    console.log(typeof '123');
    console.log(+'123');
    console.log(typeof (+'123'));
    // ------------------------
    console.log(parseInt(12.54));
    console.log(parseInt(14.4663));
    console.log(parseInt('18px'));
    console.log(parseInt('18.43px'));
    console.log(parseInt('abc12.94'));
    // ------------------------
    console.log(parseFloat(10.56));
    console.log(parseFloat(6834.287));
    console.log(parseFloat("20.573px"));
    console.log(parseFloat('50.394')); */

    let a = +prompt('请输入第一个数字:')
    let b = +prompt('请输入第二个数字:')
    alert(`俩数字的和为:${a + b}`)
  </script>
</body>

</html>